#!/user/bin/env python3
# -*- coding: utf-8 -*-
"""
--------------------------------------
    Author:     JiChao_Song
    Date  :     2020/11/13 16:54
    Desc  :
--------------------------------------
"""
from application import mongo


class Case(mongo.Document):
    CASE_LEAVEL = (
        (100, 'BVTs'),
        (101, '高'),
        (102, '中'),
        (103, '低'),
    )

    CASE_STATUS = (
        (100, 'unexecuted'),
        (101, 'pass'),
        (102, 'fail'),
        (103, 'block'),
        (104, 'closed')
    )

    caseNum = mongo.StringField()
    caseName = mongo.StringField(required = True)
    interfaceId = mongo.IntField()
    projectId = mongo.StringField()
    caseStep = mongo.ListField(mongo.DictField())
    precondition = mongo.StringField()
    module = mongo.StringField()
    caseLeavel = mongo.IntField(choices = CASE_LEAVEL, default = 101)  # 用例优先级
    caseStatus = mongo.IntField(choices = CASE_STATUS, default = 100)  # 用例优先级
    caseExpect = mongo.StringField()  # 预期结果